package com.ribbon.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @ClassName: RibbonConfig
 * @Author: ZhangYue26
 * @Description: 配置
 * @Date: 2021-01-08
 */
@Configuration
public class RibbonConfig {

    @Bean
    @LoadBalanced   /** 加上此注解此时RestTemplate就结合了Ribbon开启了负载均衡功能  */
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

}
